import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default new Router({
    // mode: 'history',
    // base: process.env.BASE_URL,
    mode: 'hash',
    base: '/',
    // 配置二级菜单路由组件
    routes: [{
            path: '/',
            redirect: '/quku/survey'
        }, {
            // 一级路由组件
            path: '/',
            // redirect: '/quku/survey',
            component: () =>
                import ( /* webpackChunkName: "home" */ '@/components/common/Home.vue'),
            meta: { title: '自述文件' },
            // 二级路由组件
            children: [
                // =====================================================================
                {
                    path: '/quku/survey',
                    component: () =>
                        import ( /* webpackChunkName: "home" */ '@/components/page/SysHome/SysHome.vue'),
                    meta: {
                        title: '曲库概况',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'QukuSurvey'
                },
                // =====================================================================
                {
                    path: '/song/admin',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuSong.vue'),
                    meta: {
                        title: '歌曲管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'QukuSong'
                },
                {
                    path: '/song/info',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/SongInfo/SongInfo.vue'),
                    meta: {
                        title: '歌曲信息',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'SongInfo'
                },
                {
                    path: '/song/checked',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuSong/SongChecked.vue'),
                    meta: {
                        title: '歌曲审核',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'SongChecked'
                },
                // =====================================================================
                {
                    path: '/singer_/admin',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuArtist.vue'),
                    meta: {
                        title: '歌手管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'QukuArtist'
                },
                {
                    path: '/singer_/edit',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/SingerInfo/SingerInfo.vue'),
                    meta: {
                        title: '歌手信息',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'SingerInfo'
                },

                {
                    path: '/singer_/add',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuArtist/AddSinger.vue'),
                    meta: {
                        title: '新增歌手',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AddSinger'
                },
                {
                    path: '/singer_/checked',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuArtist/SingerChecked.vue'),
                    meta: {
                        title: '歌手审核',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'SingerChecked'
                },
                // =====================================================================
                {
                    path: '/album_3/admin',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuAlbum.vue'),
                    meta: {
                        title: '专辑管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'QukuAlbum'
                },
                {
                    path: '/album_3/info_2',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/AlbumInfo_2/AlbumInfo_2.vue'),
                    meta: {
                        title: '专辑信息_2',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AlbumInfo_2'
                },
                {
                    path: '/album_3/checked',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuAlbum/AlbumChecked.vue'),
                    meta: {
                        title: '专辑审核',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AlbumChecked'
                },
                // =====================================================================
                {
                    path: '/mv/manage',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/MvManage.vue'),
                    meta: {
                        title: 'MV管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'MvManage'
                },
                // =====================================================================
                {
                    path: '/picture/manage',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/PictureManage.vue'),
                    meta: {
                        title: '图片管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'PictureManage'
                },
                // =====================================================================
                {
                    path: '/sensitiveinfo/admin',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuSensitiveInfo.vue'),
                    meta: {
                        title: '敏感信息管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'QukuSensitiveInfo'
                },
                // =====================================================================
                {
                    path: '/audit_/log',
                    component: () =>
                        import ( /* webpackChunkName: "qukumanage" */ '@/components/page/QukuManage/QukuAuditLog.vue'),
                    meta: {
                        title: '审核日志',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'QukuAuditLog'
                },
                // =====================================================================
                {
                    path: '/edit/menu',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/EditMenu.vue'),
                    meta: {
                        title: '编辑歌单',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditMenu'
                },
                {
                    path: '/edit/menu_1',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/EditMenu_1/EditMenu_1.vue'),
                    meta: {
                        title: '编辑歌单&审核歌单',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditMenu_1'
                },
                // =====================================================================
                {
                    path: '/radio/station',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/EditRadioStation.vue'),
                    meta: {
                        title: '编辑电台',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditRadioStation'
                },
                {
                    path: '/radio/menu_1',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/EditRadioStation/EditMenu_1.vue'),
                    meta: {
                        title: '编辑电台&审核电台',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditMenu_1'
                },
                // =====================================================================
                {
                    path: '/ranking/list',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/EditRankingList.vue'),
                    meta: {
                        title: '编辑榜单',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditRankingList'
                },
                {
                    path: '/ranking/menu_1',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/EditRankingList/EditMenu_1.vue'),
                    meta: {
                        title: '编辑榜单&审核榜单',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditMenu_1'
                },
                // =====================================================================
                {
                    path: '/audit/log',
                    component: () =>
                        import ( /* webpackChunkName: "editmanage" */ '@/components/page/EditManage/AuditLog.vue'),
                    meta: {
                        title: '审核日志',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AuditLog_1'
                },
                // =====================================================================
                {
                    path: '/label/list',
                    component: () =>
                        import ( /* webpackChunkName: "labelmanage" */ '@/components/page/LabelManage/LabelList.vue'),
                    meta: {
                        title: '标签列表',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'LabelList'
                },
                // =====================================================================
                {
                    path: '/label/level1/label',
                    component: () =>
                        import ( /* webpackChunkName: "labelmanage" */ '@/components/page/LabelManage/EditLevel1Label/EditLevel1Label.vue'),
                    meta: {
                        title: '二级标签',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditLevel1Label'
                },
                // =====================================================================
                {
                    path: '/label/level2/label',
                    component: () =>
                        import ( /* webpackChunkName: "labelmanage" */ '@/components/page/LabelManage/EditLevel2Label/EditLevel2Label.vue'),
                    meta: {
                        title: '三级标签',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditLevel2Label'
                },
                // =====================================================================
                {
                    path: '/label/level3/label',
                    component: () =>
                        import ( /* webpackChunkName: "labelmanage" */ '@/components/page/LabelManage/EditLevel3Label/EditLevel3Label.vue'),
                    meta: {
                        title: '四级标签',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditLevel3Label'
                },
                // =====================================================================
                {
                    path: '/label/level4/label',
                    component: () =>
                        import ( /* webpackChunkName: "labelmanage" */ '@/components/page/LabelManage/EditLevel4Label/EditLevel4Label.vue'),
                    meta: {
                        title: '五级标签',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditLevel4Label'
                },
                // =====================================================================
                {
                    path: '/label/level5/label',
                    component: () =>
                        import ( /* webpackChunkName: "labelmanage" */ '@/components/page/LabelManage/EditLevel5Label/EditLevel5Label.vue'),
                    meta: {
                        title: '六级标签',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'EditLevel5Label'
                },
                // =====================================================================
                {
                    path: '/batch/modify',
                    component: () =>
                        import ( /* webpackChunkName: "modifymanage" */ '@/components/page/BatchManage/BatchModify.vue'),
                    meta: {
                        title: '批量修改',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'BatchModify'
                },
                // =====================================================================
                {
                    path: '/batch_/search',
                    component: () =>
                        import ( /* webpackChunkName: "modifymanage" */ '@/components/page/BatchManage/BatchSearch.vue'),
                    meta: {
                        title: '批量查询',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'BatchSearch'
                },
                // =====================================================================
                {
                    path: '/batch_1/menu',
                    component: () =>
                        import ( /* webpackChunkName: "modifymanage" */ '@/components/page/BatchManage/BatchMenu.vue'),
                    meta: {
                        title: '批量歌单',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'BatchMenu'
                },
                // =====================================================================
                {
                    path: '/channel/list',
                    component: () =>
                        import ( /* webpackChunkName: "channelmanage" */ '@/components/page/ChannelManage/ChannelList.vue'),
                    meta: {
                        title: '渠道列表',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'ChannelList'
                },
                {
                    path: '/channel/add',
                    component: () =>
                        import ( /* webpackChunkName: "channelmanage" */ '@/components/page/ChannelManage/ChannelList/AddChannelList.vue'),
                    meta: {
                        title: '新增渠道',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AddChannel'
                },
                // =====================================================================

                {
                    path: '/terminal/type',
                    component: () =>
                        import ( /* webpackChunkName: "channelmanage" */ '@/components/page/ChannelManage/TerminalType.vue'),
                    meta: {
                        title: '终端类型',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'MealManage'
                },
                // =====================================================================
                {
                    path: '/add_/user',
                    component: () =>
                        import ( /* webpackChunkName: "channelmanage" */ '@/components/page/ChannelManage/AddUser/AddUser.vue'),
                    meta: {
                        title: '新增用户',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AddUser'

                },
                // =====================================================================
                {
                    path: '/cp/manage',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/CpManage.vue'),
                    meta: {
                        title: 'CP管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'CpManage'
                },
                {
                    path: '/cp/copyright',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/AddCopyright/AddCopyright.vue'),
                    meta: {
                        title: '新增CP',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AddCopyright'
                },
                // =====================================================================
                {
                    path: '/warehouse_/manage',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/WarehouseManage.vue'),
                    meta: {
                        title: '入库管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'WarehouseManage'
                },
                // =====================================================================
                {
                    path: '/warehouse_/app',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/WarehouseApp/WarehouseApp.vue'),
                    meta: {
                        title: '入库申请',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'WarehouseApp'
                },
                // =====================================================================
                {
                    path: '/warehouse_/details',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/AuditDetails/AuditDetails.vue'),
                    meta: {
                        title: '审核详情',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AuditDetails'
                },
                {
                    path: '/warehouse_/edit',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/AuditDetails/AuditEdit.vue'),
                    meta: {
                        title: '审核编辑',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AuditEdit'
                },
                // =====================================================================
                {
                    path: '/song_/list',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/SongList.vue'),
                    meta: {
                        title: '歌曲列表',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'SongList'
                },
                // =====================================================================
                {
                    path: '/appointment',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/Appointment.vue'),
                    meta: {
                        title: '急需续约',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'Appointment'
                },
                // =====================================================================
                {
                    path: '/song_1/detail',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/SongDetail/SongDetail.vue'),
                    meta: {
                        title: '歌曲详情',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'SongDetail'
                },
                // =====================================================================
                {
                    path: '/contract/list',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/ContractList.vue'),
                    meta: {
                        title: '合同列表',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'ContractList'
                },
                // =====================================================================
                {
                    path: '/audit_1/log',
                    component: () =>
                        import ( /* webpackChunkName: "copyrightmanage" */ '@/components/page/CopyrightManage/AuditLog.vue'),
                    meta: {
                        title: '审核日志',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'AuditLog_2'
                },

                // =====================================================================
                {
                    path: '/user_/manage',
                    component: () =>
                        import ( /* webpackChunkName: "sysmmanage" */ '@/components/page/SysManage/UserManage.vue'),
                    meta: {
                        title: '用户列表',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'UserManage'
                },
                // =====================================================================
                {
                    path: '/menu/manage',
                    component: () =>
                        import ( /* webpackChunkName: "sysmmanage" */ '@/components/page/SysManage/MenuManage.vue'),
                    meta: {
                        title: '菜单管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'MenuManage'
                },
                // =====================================================================
                {
                    path: '/role/manage',
                    component: () =>
                        import ( /* webpackChunkName: "sysmmanage" */ '@/components/page/SysManage/RoleManage.vue'),
                    meta: {
                        title: '角色管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'RoleManage'
                },
                // =====================================================================
                {
                    path: '/depart/manage',
                    component: () =>
                        import ( /* webpackChunkName: "sysmmanage" */ '@/components/page/SysManage/DepartManage.vue'),
                    meta: {
                        title: '部门管理',
                        requireAuth: true,
                        keepAlive: true
                    },
                    name: 'DepartManage'
                },
                // =====================================================================
                {
                    path: '/404',
                    component: () =>
                        import ( /* webpackChunkName: "404" */ '@/components/page/common/404.vue'),
                    meta: { title: '404' }
                },
            ]
        },
        {
            path: '/login',
            component: () =>
                import ( /* webpackChunkName: "login" */ '@/components/page/Login/Login.vue'),
            meta: {
                title: '登录',
                requireAuth: false,
                keepAlive: false
            },
            name: 'Login'
        },
        // { path: '*', redirect: '/404' }
    ]
});